function downfiles2($field, $value) {
		global $modelid,$catid,$id,$siteid;
$modelid = $modelid ? $modelid : $this->modelid;
$id = $id ? $id : $this->id;
$catid = $catid ? $catid : $this->catid;
$title = $this->data['title'];
$CAT = string2array($this->categorys[$this->catid]['setting']);
$templatename = $template?$template:$CAT['show_template'];
extract($CAT);
extract(string2array($this->fields[$field]['setting']));
		$list_str = array();
		$temp_arr=$file_list = string2array($value);
		if(is_array($file_list)) {
			foreach($file_list as $_k=>$_v) {	
				if($_v[fileurl]){
					$filename = $_v[filename] ? $_v[filename] : L('click_to_down');
					if($downloadlink) {
						$a_k = urlencode(sys_auth("i=$this->id&s=&m=1&f=$_v[fileurl]&d=$downloadtype&modelid=$this->modelid&catid=$this->catid", 'ENCODE', pc_base::load_config('system','auth_key')));
						$list_str[$_k]['url'] = APP_PATH."index.php?m=content&c=down&a_k={$a_k}";
						$list_str[$_k]['name'] = $filename;
					} else {
						$list_str[$_k]['url'] = $_v[fileurl];
						$list_str[$_k]['name'] = $filename;
					}
				}
			}
		}

$pagenumber = count($temp_arr);
                
                $pageurls = $GLOBALS['pic'] = array();
				$GLOBALS['_show1'] = 1;
				$this->url = pc_base::load_app_class('url', 'content');
				for($i=1; $i<=$pagenumber; $i++) {
					$pageurls[$i] = $this->url->show($this->id, $i, $this->data['catid'], $this->data['inputtime']);
				}
				$GLOBALS['pic']['pageurls'] = $pageurls;
	//上下页
        $this->db = $this->db ? $this->db : pc_base::load_model('content_model');
		$this->db->set_model($modelid);
		//上一页
		$previous_page = $this->db->get_one("id<'$id' AND status=99",'*','id DESC');
		//下一页
		$next_page = $this->db->get_one("id>'$id' AND status=99");
		if(empty($previous_page)) {
			$previous_page = array('title'=>L('first_page','','content'), 'thumb'=>IMG_PATH.'nopic_small.gif', 'url'=>'javascript:alert(\''.L('first_page','','content').'\');');
		}
		if(empty($next_page)) {
			$next_page = array('title'=>L('last_page','','content'), 'thumb'=>IMG_PATH.'nopic_small.gif', 'url'=>'javascript:alert(\''.L('last_page','','content').'\');');
		}
//上下页end

	foreach($list_str AS $k=>$v){
	$list_str[$k]['httpurl'] = $pageurls[$k+1][0];
    }
    $k = 0;
	//print_r($pageurls);
//静态化操作
    $CATEGORYS = $this->categorys;
	foreach($list_str as $k=>$v){	
	$pagepath = PHPCMS_PATH.$pageurls[$k+1][1];
	//echo $pagepath;
	$$field = $temp_arr;
	$picurl = $v['name'] ? $v['name'] : $temp_arr[0]['name'];
	$picurlurl = $v['url'] ? $v['url'] : $temp_arr[0]['url'];
	$alt = $v['alt'];
	$thisurl = $pageurls[$k+1][0];
	$next_url = $k+1 < $pagenumber ? $pageurls[$k+2][0] : $next_page['url'];
	$prev_url = $k>0 ? $pageurls[$k][0] : $previous_page['url'];
	$currentnum = $k ? $k+1 : 1;//当前图片id

		if(!$picurl) continue;

		//分页需要重新赋值,只运行一次
		if($k == 1){
		$info = array();
		$data = $this->data;
		foreach($this->fields as $f=>$v) {
			if(!isset($data[$f]) || $v['formtype'] == 'downfiles2') continue;
			$func = $v['formtype'];
			$vs = $data[$f];
			$result = method_exists($this, $func) ? $this->$func($f,$vs) : $vs;
			if($result !== false) $info[$f] = $result;
		}
		@extract($info);
		}
		//SEO
		$seo_keywords = '';
		if(!empty($keywords)) $seo_keywords = implode(',',$keywords).','.$v['alt'];
		$SEO = seo($siteid, $catid, $title.($k+1), $description, $seo_keywords);

		ob_start();
		include template('content',$templatename.'1');
		$data = ob_get_contents();
		ob_clean();
		$dir = dirname($pagepath);
		if(!is_dir($dir)) {
			mkdir($dir, 0777,1);
		}
		file_put_contents($pagepath, $data);
		@chmod($pagepath,0777);
		if(!is_writable($pagepath)) {
			showmessage(L('file').'：'.$pagepath.'<br>'.L('not_writable'));
		}
	}
		
		return $list_str;		
	}
